package com.corticon.dialogs.dao;

import com.corticon.dialogs.util.Pager;
import java.io.Serializable;
import java.util.List;

public interface GenericDAO<T, ID extends Serializable> {

    T load(ID id);

    T findById(ID id, boolean lock);

    T findById(ID id);

    List<T> findAll();

    List<T> findByExample(T example, String... excludeProperty);

    Serializable save(T entity);

    void update(T entity);

    void saveOrUpdate(T entity);

    T merge(T entity);

    void delete(T entity);

    long getCountAll();

    long getCountByExample(T example, String... excludeProperty);

    long getCountByUnionExamples(T[] examples, String... excludeProperty);

    List<T> getPageOfDataAll(Pager pager);

    List<T> getPageOfDataByExample(T example, Pager pager, String... excludeProperty);

    List<T> getPageOfDataByUnionExamples(T[] examples, Pager pager, String... excludeProperty);
}
